﻿@{
    ViewBag.Title = "Quản trị danh sách người dùng";
    Layout = "~/Views/Shared/Admin/_AdminLayout.cshtml";
}
@model WebCore.Models.ViewModels.Admin.UserListViewModel

@Styles.Render("~/Content/Product/Admin/Product.css")
@Styles.Render("~/Content/ThirdParties/PagedList.css")

<h3 class="page-title">Quản trị danh sách người dùng </h3>
<br />
Tìm kiếm @Html.TextBox("FilterKey")
theo <select id="FilterBy" name="FilterBy">
    <option value="AccountName">Tên tài khoản</option>
    <option value="Fullname">Tên hiển thị</option>
    <option value="Email">Email</option>
    <option value="Phone">Số điện thoại</option>
    <option value="Address">Địa chỉ</option>
</select> thành viên
<select id="FilterRole" name="FilterRole">
    @Html.Partial("Account/Admin/_RolesDropdownlist", String.IsNullOrEmpty(Model.FilterRole)? Guid.Empty: new Guid(Model.FilterRole))
</select>
trạng thái
<select id="FilterState" name="FilterState">
    @Html.Partial("Account/Admin/_StateDropDownList", Model.FilterState ?? "")
</select>
<input type="button" onclick="javascript:onFilter()" value="Lọc" />
<br /><br />
@Html.Partial("Account/Admin/_UserList", Model.UserListPartialViewModel)

@section scripts
{
    <script type="text/javascript">
        function onFilter() {
            var key = $('#FilterKey').val();
            var by = $('#FilterBy option:selected').val();
            var role = $('#FilterRole option:selected').val();
            var state= $('#FilterState option:selected').val();;
            window.location = '@Url.Action("UserList","Admin")?key=' + key + "&by=" + by + "&role=" + role + "&state=" + state;
        }
    </script>
}